package org.ytor.core.sqlflow.config;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * DruidConfig配置类
 */
@Configuration
public class DruidConfig {

    /**
     * 屏蔽Druid广告
     */
    @Bean
    public FilterRegistrationBean<DruidAdRemoveFilter> removeDruidAdFilter() {
        FilterRegistrationBean<DruidAdRemoveFilter> registrationBean = new FilterRegistrationBean<>();
        registrationBean.setFilter(new DruidAdRemoveFilter());
        registrationBean.addUrlPatterns("/druid/js/common.js");
        registrationBean.setName("druidAdRemoveFilter");
        registrationBean.setOrder(1);
        return registrationBean;
    }

}
